//
//  ShadowShape.m
//  QuartzStudy
//
//  Created by longhuihu on 11-6-21.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "ShadowShape.h"


@implementation ShadowShape


- (void)drawRect:(CGRect)rect
{
	[super drawRect:rect];
	
	CGContextRef context = UIGraphicsGetCurrentContext();
	
	CGFloat white[] = {1.0,1.0,1.0,1.0};
	CGContextSetFillColor(context, white);
	CGContextFillRect(context, self.bounds);
	
	CGContextSetShadow(context, CGSizeMake(0, 2), 2);
	
	CGFloat colorComponents[] = {1.0,0.0,0.0,1.0};
	CGContextSetFillColor(context, colorComponents);
	CGContextAddEllipseInRect(context, CGRectMake(5,30,90,50));
	CGContextDrawPath(context, kCGPathFill);
}


@end
